package per.zqx.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import per.zqx.pojo.Order;
import per.zqx.service.OrderService;

import java.time.LocalDateTime;

/**
 * DispatcherController,
 *
 * @author Sa, Zhang 2021-08-15 16:40
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    OrderService orderService;

    @GetMapping("/add")
    public void saveOrder(){
        LocalDateTime now = LocalDateTime.now();
        Order order = new Order();
        order.setBuyer("Sa");
        order.setContent("肥宅快乐水");
        order.setCreateTime(now);
        order.setUpdateTime(now);
        orderService.add(order);

    }
}
